<?php

namespace App\Models\Tool;

use App\Models\BaseModel;

class District extends BaseModel
{

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'parent_id',
        'name',
        'type',
        'first_letter',
    ];

    protected $hidden = [
        'priority'
    ];

    protected $primaryKey = 'id';
    public $timestamps = false;


    public function getById($id){
        return $this->where('id', $id)->first();
    }

    public function getByName($name){
        return $this->where('name', $name)->first();
    }
}
